#include <bits/stdc++.h>
using namespace std;
#define int long long
void solve()
{
    int x,y,a,b;
    int x1,y1,x2,y2;
    cin>>x>>y>>a>>b;
    cin>>x1>>y1>>x2>>y2;
    bool f=0,g=0;
    if(x1<x2)swap(x1,x2);
    if(x1>x2+a&&(x1-x2-a)%a)f=1;
    if(x1<x2+a)f=1;
    if(y1<y2)swap(y1,y2);
    if(y1>y2+b&&(y1-y2-b)%b)g=1;
    if(y1<y2+b)g=1;
    if(f&&g)cout<<"NO"<<endl;
    else cout<<"YES"<<endl;
}
signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int T=1;
    cin>>T;
    while(T--)
    {
       solve();
    }
    return 0;
}